package apiday07home;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class OOSDemo {
    public static void main(String[] args) throws IOException {
        String name = "李四";
        int age=23;
        String gender = "广安";
        String[] otherInfo = {"是一名学生", "爱好游泳", "喜欢旅游"};
        Student ls = new Student(name, age, gender, otherInfo);
        System.out.println(ls);
        FileOutputStream fps = new FileOutputStream("aaa.txt");
        ObjectOutputStream ops = new ObjectOutputStream(fps);
        ops.writeObject(ls);
        System.out.println("写入完毕");
        ops.close();


    }
}
